#pragma once
#include <thread>
#include <vector>
#include <tuple>
#include <memory>
#include "Queue.h"
struct AsyncDataSaver
{
	AsyncDataSaver(const char * path);
	~AsyncDataSaver();
	void Save(const char * pDst, const int dstLen);
	void Finish();
private:
	void CoreSave();
	bool m_saving;
	FILE* m_file;
	//std::vector<FILE*> m_files;
	az::queue<std::tuple<std::shared_ptr<char>, int>> m_datas;
	std::thread *m_pthread;
};

